package Blinkwater;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class javarunner {
    public static void main(String[] args) throws InterruptedException {
        try {
//            Process res = Runtime.getRuntime().exec("python3 /home/hatelys/blindwater/BlindWatermark-master/bwm.py -k 4399 2333 32 -em -r /home/hatelys/blindwater/BlindWatermark-master/pic/lena_grey.png -wm /home/hatelys/blindwater/BlindWatermark-master/pic/wm.png -o /home/hatelys/blindwater/BlindWatermark-master/out.png -s");


//            提取
            /*
            * python bwm.py -k 4399 2333 32 -ex -r out.png -wm pic/wm.png -ws 64 64 -o out_wm.png -s
            * */
            Process res = Runtime.getRuntime().exec("python3 /home/hatelys/blindwater/BlindWatermark-master/bwm.py -k 4399 2333 32 -em -r /home/hatelys/blindwater/BlindWatermark-master/pic/lena_grey.png -wm /home/hatelys/blindwater/BlindWatermark-master/pic/wm.png -o /home/hatelys/blindwater/BlindWatermark-master/out.png -s");
            BufferedReader in = new BufferedReader(new InputStreamReader(res.getInputStream()));
            String line;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }

            in.close();
            res.waitFor();
        } catch (IOException e) {
            System.out.println("执行错误");
            throw new RuntimeException(e);
        }
    }
}
